package com.kantboot.business.water.repository;

import com.kantboot.business.water.domain.entity.BusWaterUserLiftingPoint;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * 水站提水点
 */
public interface BusWaterUserLiftingPointRepository extends JpaRepository<BusWaterUserLiftingPoint,Long> {

    /**
     * 根据用户id删除所有提水点
     */
    @Transactional
    @Modifying
    @Query("DELETE FROM BusWaterUserLiftingPoint WHERE userId = ?1")
    void deleteByUserId(Long userId);

}
